#include<stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
#include<string.h>
#define FILE_NAME(number) "log.txt"#number
int main()
{

umask(0);

FILE* fp =fopen("./log.txt",O_WRONLY|O_CREAT|O_APPEND,0666);
//int fd = open("./log.txt",O_RDONLY);
if(fd < 0)
{
    perror("open");
    return 1;
}
//char ch[1024];
//read(fd,ch,sizeof(ch)-1);
const char* ch = "hello Lixx\n";
write(fp->_fileno,ch,strlen(ch));
//write(fd,ch,strlen(ch));
//write(fd,ch,strlen(ch));
//write(fd,ch,strlen(ch));
//write(fd,ch,strlen(ch));
//write(fd,ch,strlen(ch));
close(fd);
printf("%s",ch);
return 0;
}
